//lambda
fun main() {
    //具名函数引用
    showOnBoard("卫生纸",::getDiscountWords)
}

private fun getDiscountWords(goodsName:String, hour:Int):String{
    var currentYear = 2027
    return "${currentYear}年，双11${goodsName}促销倒计时：${hour}小时"
}

private fun showOnBoard(goodsName:String, getDiscountWords:(String,Int)->String) {
    var hour = (1..24).shuffled().last()
    println(getDiscountWords(goodsName,hour))
}